home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / e / mailinglists / amigae.0294feb.archive / 000086_donews!crash!pl….af.mil!bwills_Sat, 19 Feb 94 10:02:35 PST.msg < prev    next >
Internet Message Format  |  1994-05-26  |  3KB

  1. Received: by bkhouse.cts.com (V1.17-beta/Amiga)
  2.       id <1vgm@bkhouse.cts.com>; Sat, 19 Feb 94 10:02:35 PST
  3. Received: from crash by donews.cts.com with uucp
  4.     (Smail3.1.28.1 #18) id m0pXehd-00021yC; Fri, 18 Feb 94 18:33 EST
  5. Received: from kirk.safb.af.mil by crash.cts.com with smtp
  6.     (Smail3.1.28.1 #18) id m0pXd7M-0000JTC; Fri, 18 Feb 94 13:52 PST
  7. Received: from ike (ike [140.175.6.44]) by kirk.safb.af.mil (8.6.4/8.6.4) with SMTP id PAA25470 for <AmigaE@bkhouse.cts.com>; Fri, 18 Feb 1994 15:51:34 -0600
  8. Received: from plucky.safb.af.mil by ike (4.1/SMI-4.1)
  9.     id AA11289; Fri, 18 Feb 94 15:47:39 CST
  10. Received: by plucky.safb.af.mil (4.1/SMI-4.1)
  11.     id AA01661; Fri, 18 Feb 94 15:49:19 CST
  12. Date: Fri, 18 Feb 94 15:49:19 CST
  13. Message-Id: <9402182149.AA01661@plucky.safb.af.mil>
  14. From: bwills@plucky.safb.af.mil (Barry D Wills)
  15. To: 
  16. Subject: Re: Bugs in the Mod() function
  17.  
  18. *B) Right, and in EVERY example you cited in your previous message you
  19. *B) carefully [and correctly] used the term "remainder".  The fact is
  20. *B) that this statement [QUOTE or not] is incorrect... 'modulo' is a
  21. *B) perfectly well-defined term [go check a textbook on abstract algebra
  22.  
  23. Guess I'll have to in order to see just what you mean,
  24. Bernie.  Every computer language I've dealt with, from 
  25. Ada to Pascal to E to C to BASIC all use the Mod() 
  26. function in the same way.  It seems to be a prevalent
  27. convention, regardless of it's origin and/or any
  28. similarity to another term in another realm of operation.
  29.  
  30. Sounds from your example like:
  31.  
  32.   WriteF('time=12: 15 hours later it's \d\n', Mod(15, 12))
  33.  
  34. writes:
  35.  
  36.   time=12: 15 hours later it's 3
  37.  
  38. I still don't see it.  Mod(12,12) = 0, just like the example.
  39.  
  40. *B) } This will give weird results if c exceeds max-int.
  41. *B) } Wouter likes it this way, so I made a function that
  42. *B) } does 32bit modulo:
  43. *B) } 
  44. *B) }   PROC mod(this, bythat) RETURN this-Mul(bythat, Div(this, bythat))
  45. *B) 
  46. *B) Unfortunately it doesn't.  It returns the *remainder*.  Not the same
  47.  
  48. By any definition I am familiar with it does.  You better
  49. hurry up and edumuhcate us before Wouter releases a
  50. Compiler Authoring Tutorial and suddenly a hundred other
  51. languages arise, all with a Mod function or operator that 
  52. performs against your expectations. :-D
  53.  
  54. Ahem, sorry.  I couldn't resist the opportunity. :-)
  55.  
  56. *B) it doesn't matter what you do].  As I suggested, if Wouter just
  57. *B) changes the docs to call it "Rem" or some such, my program wouldn't
  58. *B) have been any closer-to-working but at least it'd have been clear
  59. *B) what is going on.
  60. *B) 
  61. *B) Not a big deal in any scheme of things, but one of my hot-buttons since
  62.  
  63. Heh, kinda like me and tail-gaters. }:-(
  64.  
  65. *B) I've been trying to argue some _basic_ math into hardheaded hardware
  66. *B) designers for almost 30 years now....
  67.  
  68. Preseverence!  Changing tradition, nearly impossible
  69. sometimes.
  70.  
  71. -- Barry
  72.